<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import Layout from './components/Layout.vue'

const route = useRoute()
const isPreviewPage = computed(() => route.name === 'html-preview')
</script>

<template>
  <!-- 预览页面不使用Layout包装，显示纯净页面 -->
  <div v-if="isPreviewPage">
    <router-view></router-view>
  </div>
  
  <!-- 其他页面使用Layout包装，显示导航栏 -->
  <Layout v-else>
    <router-view></router-view>
  </Layout>
</template>

<style>
@import './styles/theme.css';

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
}
</style>
